﻿using System;
using System.Collections.Generic;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CubicFWNet.Data.Models.Mapping
{
    public class TechnologyItemMap : EntityTypeConfiguration<TechnologyItem>
    {
        public TechnologyItemMap()
        {
            // Primary Key
            this.HasKey(t => t.Id);

            // Properties
            this.Property(t => t.CreatorName)
                .HasMaxLength(64);

            this.Property(t => t.WorkLenth)
                .HasMaxLength(64);

            this.Property(t => t.Memo)
                .HasMaxLength(256);

            // Table & Column Mappings
            this.ToTable("TechnologyItem");
            this.Property(t => t.Id).HasColumnName("Id");
            this.Property(t => t.TechnologyId).HasColumnName("TechnologyId");
            this.Property(t => t.MaterialId).HasColumnName("MaterialId");
            this.Property(t => t.Status).HasColumnName("Status");
            this.Property(t => t.CreateTime).HasColumnName("CreateTime");
            this.Property(t => t.CreatorId).HasColumnName("CreatorId");
            this.Property(t => t.CreatorName).HasColumnName("CreatorName");
            this.Property(t => t.WasteOri).HasColumnName("WasteOri");
            this.Property(t => t.WasteNow).HasColumnName("WasteNow");
            this.Property(t => t.WasteW).HasColumnName("WasteW");
            this.Property(t => t.WasteH).HasColumnName("WasteH");
            this.Property(t => t.WasteDif).HasColumnName("WasteDif");
            this.Property(t => t.MaterialCost).HasColumnName("MaterialCost");
            this.Property(t => t.WorkersNum).HasColumnName("WorkersNum");
            this.Property(t => t.WorkLenth).HasColumnName("WorkLenth");
            this.Property(t => t.Memo).HasColumnName("Memo");
            this.Property(t => t.Data).HasColumnName("Data");
            this.Property(t => t.GiveH).HasColumnName("GiveH");
            this.Property(t => t.GiveW).HasColumnName("GiveW");
            this.Property(t => t.Amount).HasColumnName("Amount");
            this.Property(t => t.Count).HasColumnName("Count");
        }
    }
}
